class Page10 extends BaseScreen {
    public constructor() {
        super();
        this.skinName = "resource/eui_skins/Page10Skin.exml";
    }

	private img_1: eui.Image;
    private img_2: eui.Image;
    private img_3: eui.Image;
    private img_4: eui.Image;
    private img_5: eui.Image;
    private img_6: eui.Image;
    private img_7: eui.Image;
    private img_8: eui.Image;
    private img_9: eui.Image;
    private img_10: eui.Image;
    private img_10_y:number = 0;
    private img_5_x:number = 0;



    protected childrenCreated(): void {
        super.childrenCreated();
        this.img_5_x = this.img_5.x;
        this.img_10_y = this.img_10.y;

        this.init_view();
        
        this.anchorOff(this.img_2);
        this.anchorOff(this.img_3);
        this.anchorOff(this.img_6);
        this.anchorOff(this.img_7);
        this.anchorOff(this.img_8);
        this.anchorOff(this.img_9);

        
        this.resetui();
    }

    public resetui(){
        this.img_1.alpha = 0;
        this.img_2.scaleX = this.img_2.scaleY = 0;
        this.img_3.scaleX = this.img_3.scaleY = 0;
        this.img_6.scaleX = this.img_6.scaleY = 0;
        this.img_7.scaleX = this.img_7.scaleY = 0;
        this.img_8.scaleX = this.img_8.scaleY = 0;
        this.img_9.scaleX = this.img_9.scaleY = 0;
        this.img_10.scaleY = 0;
        this.img_4.x = -this.img_4.width;
        this.img_5.x = 640;

        if(this.xx_page){
            this.xx_page.stop();
        }

    }

    public init_view() {
        this.showPage();
    }

    public showPage() {
        super.showPage();
        this.resetui();
        
        console.log('this.img_5_x='+this.img_5_x);
        console.log('this.img_10_y='+this.img_10_y);

        egret.Tween.get(this.img_1).to({ alpha:1}, 2000);

        egret.Tween.get(this.img_2).wait(300).to({ scaleX: 1,scaleY:1}, 900, egret.Ease.backOut);
        egret.Tween.get(this.img_3).wait(500).to({ scaleX: 1,scaleY:1}, 1000, egret.Ease.backOut);
        egret.Tween.get(this.img_4).wait(500).to({ x:0}, 400);
        egret.Tween.get(this.img_5).wait(500).to({ x: this.img_5_x}, 400);
        egret.Tween.get(this.img_6).wait(1000).to({ scaleX: 1,scaleY:1}, 1000, egret.Ease.backOut);
        egret.Tween.get(this.img_7).wait(1200).to({ scaleX: 1,scaleY:1}, 800, egret.Ease.backOut);
        egret.Tween.get(this.img_8).wait(1200).to({ scaleX: 1,scaleY:1}, 800, egret.Ease.backOut);
        egret.Tween.get(this.img_9).wait(1300).to({ scaleX: 1,scaleY:1}, 800, egret.Ease.backOut);
        egret.Tween.get(this.img_10).wait(1500).to({ scaleY:1}, 800, egret.Ease.backOut);
        if(this.xx_page){
            this.xx_page.start();
        }
    }

    public resize(): void {
         super.resize();
    }

}